<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="/common/common.jspf"%>
<script type="text/javascript" src="${ctx}/js/system/user/add.js">
	
</script>
<style type="text/css">
.col-sm-3 {
    position: relative;
    top: 8px;
	width: 15%;
	float: left;
	text-align: right;
}

.col-sm-9 {
	width: 32%;
	float: left;
	text-align: left;
}


label[class^="btn btn-default"] {
	margin-top: -4px;
}
</style>
</head>
<body>
	<div class="l_err" style="width: 100%; margin-top: 2px;"></div>
	<form id="form" name="form" class="form-horizontal" method="post"
		action="${ctx}/homework/addData.shtml">
		<section class="panel panel-default">
		<div class="panel-body">
			<div class="form-group">
				<div class="col-sm-3">
					<label class="control-label">作业编号</label>
				</div>
				<div class="col-sm-9">
					<input type="text" class="form-control"
						   name="homeWorkFormMap.ly_homework_code" id="ly_homework_code">

				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">工序号</label>
					<div class="col-sm-9">
						<input type="text" class="form-control"
							   name="homeWorkFormMap.ly_process_code"
							   id="ly_process_code">

					</div>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">设备</label>
				<div class="col-sm-9">
					<input type="text" class="form-control"
						   name="homeWorkFormMap.ly_equipment"
						   id="ly_equipment">
				</div>

				<div class="form-group">
					<label class="col-sm-3 control-label">工序</label>
					<div class="col-sm-9">
						<select class="form-control" name="homeWorkFormMap.ly_process_name" id="ly_process_name">
							<option value="003">下达</option>
						</select>
					</div>
				</div>
			</div>


			<div class="form-group">
				<label class="col-sm-3 control-label">产品</label>
				<div class="col-sm-9">
					<input type="text" class="form-control"
						   name="homeWorkFormMap.ly_product" id="ly_product">
					<span class="input-group-btn">
							<button class="btn btn-info" id="workorder" type="button"
									style="height: 34px; position: relative; top: -34px; left: 210px;"
									onclick="getItemBom('stockid','item_bom_name');">
								<span class="glyphicon glyphicon-search"></span>
							</button>
					</span>
				</div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">班定产额</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control"
                               name="homeWorkFormMap.ly_num"
                               id="ly_num">

                    </div>
                </div>
			</div>

			<div class="line line-dashed line-lg pull-in"></div>
		<footer class="panel-footer text-right bg-light lter">
		<button type="submit" class="btn btn-success btn-s-xs">提交</button>
		</footer>

		</section>
	</form>

	<script type="text/javascript">
		onloadurl();
	</script>
	<script type="text/javascript"
		src="${ctx}/notebook/notebook_files/bootstrap-filestyle.min.js"></script>
<script type="text/javascript">
	//自动生成id
	//
	$(document).ready(function(){
		var myDate = getNowFormatDate();
		$("#ofcode").val("OF"+ myDate + getRandomInt(100,1000));
	});
	function getNowFormatDate() {
		var date = new Date();
		var seperator1 = "-";
		var seperator2 = ":";
		var year = date.getFullYear();
		var month = date.getMonth() + 1;
		var strDate = date.getDate();
		if (month >= 1 && month <= 9) {
			month = "0" + month;
		}
		if (strDate >= 0 && strDate <= 9) {
			strDate = "0" + strDate;
		}
		//OF2022-02-12 13:52:30
		var currentdate = year + seperator1 + month + seperator1 + strDate
				+ date.getHours() + seperator2 + date.getMinutes()
				+ seperator2 + date.getSeconds();
        currentdate= currentdate.replaceAll("-","");
        currentdate= currentdate.replaceAll(":","");
		return currentdate;
	}

    function getRandomInt(min, max) {
        min = Math.ceil(min);
        max = Math.floor(max);
        return Math.floor(Math.random() * (max - min)) + min; //不含最大值，含最小值
    }
</script>
</body>
</html>